package com.javapoing.bo;

import java.util.List;

import org.apache.commons.beanutils.BeanUtils;
import org.springframework.context.ApplicationContext;

import com.javapoint.SpringContext;
import com.javapoint.ibatis.mappings.dao.UserDAO;
import com.javapoint.mapping.entity.vo.User;

public class UsuarioBO {
	
	public void regristrarUsuario(User user){
		ApplicationContext ctx = SpringContext.getContext();
		UserDAO userDAO =  (UserDAO)ctx.getBean("userDao");
		com.javapoint.ibatis.entity.vo.User userModel = new com.javapoint.ibatis.entity.vo.User();
		userModel.setFirstName(user.getFirstName());
		userModel.setLastName(user.getLastName());
		userModel.setEmail(user.getEmailAddress());
		userModel.setId(Integer.toString(user.getEmailAddress().hashCode()));
		userModel.setPhone(5555);
		userModel.setAddress("");
		userModel.setOtherUserDetails("");
		userDAO.insert(userModel);
		userDAO.insert(userModel);
	}
	
	public void actualizarUsuario(User user){
		
	}
	
	public void eliminarUsuario(User user){
		
	}
	
	public List retornarUsuarios(){
		List list = null;
		return list;
	}
}
